package com.zhouker.workback.controller;

import com.zhouker.workback.model.UserLoginModel;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ASUS
 */
@RestController
public class UserLoginController {
	@RequestMapping(path = {"/login"}, method = RequestMethod.POST)
	public String getUsers(@RequestParam(value = "userid") String uid,
						   @RequestParam(value = "password") String pwd) {
		UserLoginModel userLoginModel = new UserLoginModel();
		if (userLoginModel.userLogin(uid, pwd)) {
			return String.format("%s login in success", uid);
		} else {
			return String.format("%s login in failed", uid);
		}
	}
}
